package com.service.business.rabbitmq.support;

import com.service.business.base.constants.RedisLockConstant;
import com.service.business.support.RedissonLockUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class MqMsgLockUtils extends RedissonLockUtils {

    public static String buildMqMsgLockKey(Long msgId) {
        return RedisLockConstant.MQ_MSG + msgId;
    }

    public boolean lockOrder(Long msgId){
        return  super.lock(buildMqMsgLockKey(msgId));
    }

    public void unlockOrder(Long msgId){
        super.unlock(buildMqMsgLockKey(msgId));
    }


}
